package org.xt.module.api;

import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.By;
import org.nutz.mvc.annotation.Filters;
import org.nutz.mvc.annotation.Ok;
import org.xt.constants.Res;
import org.xt.entity.OutputData;
import org.xt.entity.OutputItem;
import org.xt.service.OutputDataService;
import org.xt.service.OutputItemService;
@IocBean
@At("/api/output/data")
public class OutputDataApiModule {
	@Inject
	private Dao dao;
	@Inject
	private OutputDataService outputService;
	
	@At("/add")
	@Ok("json")
	public Res add(OutputData item){
		return outputService.add(item);
	}
	
	@At("/update")
	@Ok("json")
	public Res update(OutputData item){
		return outputService.update(item);
	}
	
	@At("/delete")
	@Ok("json")
	public Res delete(OutputData item){
		return outputService.delete(item);
	}
	
	@At("/list")
	@Ok("json")
	public Res list(int machineId){
		return Res.NEW().code(Res.SUCCESS).msg("ok").data(outputService.list(machineId));
	}
}
